package com.orange.cetback.controller.admin;

import com.orange.cetback.common.vo.PageResult;
import com.orange.cetback.common.vo.Result;
import com.orange.cetback.pojo.dto.UserDTO;
import com.orange.cetback.pojo.entity.User;
import com.orange.cetback.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController("AdminUserController")
@RequestMapping("/admin-api/user")
@Tag(name = "用户接口")
public class UserController {
    @Autowired
    private UserService userService;

    @Operation(summary = "分页查询用户信息")
    @PostMapping("/page")
    public Result<PageResult<User>> page(@RequestBody UserDTO userDTO) {
        PageResult<User> pageResult = userService.pageQuery(userDTO);
        return Result.success(pageResult);
    }
}
